//
//  XMVisitorViewController.m
//  sinaWeiBo
//
//  Created by 孟发 on 4/7/16.
//  Copyright © 2016 夏孟发. All rights reserved.
//功能模块控制器的基类控制器-访客视图控制器

#import "XMVisitorViewController.h"
#import "XMVisitorView.h"

@interface XMVisitorViewController ()

@end

@implementation XMVisitorViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //用户登记标记
    BOOL userLogin = YES;
    self.userLogin = userLogin;
    
    [self setupVisitorView];
}

- (void)loadView{
    if (self.userLogin) {
        [super loadView];
    }else{//进入游客模式
        [self setupVisitorView];
    }
}

//设置访客视图
- (void)setupVisitorView{
    XMVisitorView *visitorView = [[XMVisitorView alloc] init];
    //替换根视图
    self.visitorView = visitorView;
    
    self.view = visitorView;
    //设置导航栏按钮
    self.navigationItem.leftBarButtonItem = UIBarButtonItemStylePlain;
    self.navigationItem.leftBarButtonItem.title = @"注册";
    self.navigationItem.rightBarButtonItem = UIBarButtonItemStylePlain;
    self.navigationItem.rightBarButtonItem.title = @"登录";
   
}



@end
